﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data ;
using System.Data.SqlTypes;
using System.Text ;

using DataAccessLayer;

namespace BusinessLayer
{
    public class GetContracts
    {
        private string title;
        private string description;
        private string contract_agreement;

        public GetContracts()
        {
            title = "";
            description = "";
            contract_agreement = "";

        }
        public GetContracts(string ti, string des, string c_a)
        {
            title = ti;
            description = des;
            contract_agreement = c_a;
        }
        public string P_Title
        {
            get { return title; }
            set { title = value; }
        }

        public string P_Description
        {
            get { return description; }
            set { description = value; }
        }

        public string P_Contract_agreement
        {
            get { return contract_agreement; }
            set { contract_agreement = value; }
        }

        public List<GetContracts> get_contract()
        {
            List<csparameterListType> par = new List<csparameterListType>();
            List<GetContracts> objlist = new List<GetContracts>();
            DataAccessLayer.csDAL objdal = new DataAccessLayer.csDAL();

            IDataReader datareader = null;

            datareader = objdal.executespreturndr("GET_CART1");

            while (datareader.Read())
            {
                GetContracts objP = new GetContracts();
                populate_reader(datareader, objP);
                objlist.Add(objP);
            }
            return objlist;
        }

        private void populate_reader(IDataReader datareader, GetContracts objP)
        {
            objP.P_Title = datareader.GetString(0);
            objP.P_Description = datareader.GetString(1);
            objP.P_Contract_agreement = datareader.GetString(2);
           
        }
    }
}